package com.sc3.game.server;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.sc3.game.logic.UserLogic;
import com.sc3.game.serverbean.UserBean;
import com.sc3.game.service.UserService;
import com.sc3.game.sharedbean.User;

@SuppressWarnings("serial")
public class UserServiceImpl extends RemoteServiceServlet  implements UserService {

	@Override
	public boolean login(String userName, String password) {
		if(userName.equals("admin@gmail.com") && password.equals("123456")){
			return true;
		}
		return false;
	}

	@Override
	public String createClientID() {
		return null;
	}

	@Override
	public User validate(String clientID) {
		return null;
	}

	@Override
	public User login(String email, String password, String clientID) {
		UserBean user = UserLogic.login(email, password);
		return ServerUtil.userBeam2User(user);
	}

}
